home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-18 | 2.0 KB | 79 lines |
- /*
- * @(#)ISAPIInputStream.java 1.5 97/05/11
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- * CopyrightVersion 1.0
- */
-
- package sun.servlet.isapi;
-
- import java.io.InputStream;
- import java.io.IOException;
- import sun.servlet.http.HttpInputStream;
-
- /**
- * This class implements an input stream for reading ISAPI extension
- * request data.
- *
- * @version 1.5, 05/11/97
- * @author David Connelly
- * @author Jongyoon Lee
- */
- class ISAPIInputStream extends HttpInputStream {
- /*
- * The ECB (Extension Control Block) for this request.
- */
- private ISAPIConnection conn;
-
- /*
- * Initializes the input stream with the ECB for this request.
- */
- public void init(ISAPIConnection conn) {
- this.conn = conn;
- next();
- }
-
- /*
- * Resets the input stream to an uninitialized state.
- */
- public void resets() {
- conn = null;
- }
-
- /**
- * Returns the number of bytes that can be read without blocking.
- * @return the number of available bytes
- */
- public int available() {
- return Integer.MAX_VALUE;
- }
-
- /**
- * Fills input buffer with more data.
- */
- protected void fill() throws IOException {
- int len = Math.min(buf.length, limit - total);
- if (len > 0) {
- len = (int) conn.getData(total, buf, 0, len);
- if (len > 0) {
- pos = 0;
- count = len;
- }
- }
- }
- }
-